package com.far.game.xiuzhen.common.enums.game;

import com.far.game.xiuzhen.common.interf.IEnums;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public enum  JobEnums implements IEnums {


    ZHAN("战",1),
    DUN("盾",2),
    FU("辅",3);


    private int val;
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getVal() {
        return val;
    }

    public void setVal(int val) {
        this.val = val;
    }

    JobEnums(String name,int val){
        this.name = name;
        this.val = val;
    }
    public static int valueOfName(String name){
        List<JobEnums> data =  Arrays.stream(JobEnums.values()).filter(e->{
            return e.getName().equals(name);
        }).collect(Collectors.toList());
        return data.get(0).getVal();
    }



}
